package com.example.demo4.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Mytest2 {
    @GetMapping("test2")
    public String test2(String user){
        return user;
    }
    @GetMapping("test3")
    public String test3(@RequestParam(value = "username",required = false) String user){
        return user;
    }
@GetMapping("test4")
    public String test4(String user,int age){
        return  user+age;
}
}
